package com.miao.entity;

/**
 * 用来记录后端代码生成文件位置
 */
public class Package {
    /**
     * 项目路径
     */
    private String parent;
    /**
     * 子路径
     */
    private String subRouting;
    private String controller;
    private String service;
    private String dao;
    private String impl;
    private String dto;
    private String entity;

    private Package(PackageBuild build) {
        this.parent = build.parent;
        this.subRouting = build.subRouting;
        this.controller = build.controller;
        this.service = build.service;
        this.dao = build.dao;
        this.impl = build.impl;
        this.dto = build.dto;
        this.entity = build.entity;
    }

    public String getParent() {
        return parent;
    }

    public void setParent(String parent) {
        this.parent = parent;
    }

    public String getSubRouting() {
        return subRouting;
    }

    public void setSubRouting(String subRouting) {
        this.subRouting = subRouting;
    }

    public String getController() {
        return controller;
    }

    public void setController(String controller) {
        this.controller = controller;
    }

    public String getService() {
        return service;
    }

    public void setService(String service) {
        this.service = service;
    }

    public String getDao() {
        return dao;
    }

    public void setDao(String dao) {
        this.dao = dao;
    }

    public String getImpl() {
        return impl;
    }

    public void setImpl(String impl) {
        this.impl = impl;
    }

    public String getDto() {
        return dto;
    }

    public void setDto(String dto) {
        this.dto = dto;
    }

    public String getEntity() {
        return entity;
    }

    public void setEntity(String entity) {
        this.entity = entity;
    }

    @Override
    public String toString() {
        return "Package{" +
                "parent='" + parent + '\'' +
                ", subRouting='" + subRouting + '\'' +
                ", controller='" + controller + '\'' +
                ", service='" + service + '\'' +
                ", dao='" + dao + '\'' +
                ", impl='" + impl + '\'' +
                ", dto='" + dto + '\'' +
                ", entity='" + entity + '\'' +
                '}';
    }

    public static class PackageBuild {
        private String parent;
        private String subRouting;
        private String controller;
        private String service;
        private String dao;
        private String impl;
        private String dto;
        private String entity;

        public PackageBuild() {
        }

        public PackageBuild Parent(String parent) {
            this.parent = parent;
            return this;
        }

        public PackageBuild SubRouting(String subRouting) {
            this.subRouting = subRouting;
            return this;
        }

        public PackageBuild Controller(String controller) {
            this.controller = controller;
            return this;
        }

        public PackageBuild Service(String service) {
            this.service = service;
            return this;
        }

        public PackageBuild Dao(String dao) {
            this.dao = dao;
            return this;
        }

        public PackageBuild Impl(String controller) {
            this.impl = controller;
            return this;
        }


        public PackageBuild Dto(String controller) {
            this.dto = controller;
            return this;
        }

        public PackageBuild Entity(String controller) {
            this.entity = controller;
            return this;
        }

        public Package build() {
            return new Package(this);
        }

    }
}
